package com.cfpl.project_common.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.NonNull;

import java.io.Serializable;
import java.util.Date;

/**
 * @TableName pesticide_usage_record
 */
@TableName(value ="pesticide_usage_record")
public class PesticideUsageRecord implements Serializable {
    private Long id;

    @NonNull
    @ApiModelProperty(required = true)
    private Long pesticideTypeId;

    private Date usedDate;
    @NonNull
    @ApiModelProperty(required = true)
    private Long plantingLocationId;
    @NonNull
    @ApiModelProperty(required = true)
    private Long pesticideAcquireRecordId;
    @NonNull
    @ApiModelProperty(required = true)
    private Long vegetableManagementId;

    private Long adminId;

    @NonNull
    @ApiModelProperty(required = true)
    private Integer pesticideDosage;

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getPesticideTypeId() {
        return pesticideTypeId;
    }

    public void setPesticideTypeId(Long pesticideTypeId) {
        this.pesticideTypeId = pesticideTypeId;
    }

    public Date getUsedDate() {
        return usedDate;
    }

    public void setUsedDate(Date usedDate) {
        this.usedDate = usedDate;
    }

    public Long getPlantingLocationId() {
        return plantingLocationId;
    }

    public void setPlantingLocationId(Long plantingLocationId) {
        this.plantingLocationId = plantingLocationId;
    }

    public Long getPesticideAcquireRecordId() {
        return pesticideAcquireRecordId;
    }

    public void setPesticideAcquireRecordId(Long pesticideAcquireRecordId) {
        this.pesticideAcquireRecordId = pesticideAcquireRecordId;
    }

    public Long getVegetableManagementId() {
        return vegetableManagementId;
    }

    public void setVegetableManagementId(Long vegetableManagementId) {
        this.vegetableManagementId = vegetableManagementId;
    }

    public Long getAdminId() {
        return adminId;
    }

    public void setAdminId(Long adminId) {
        this.adminId = adminId;
    }

    public Integer getPesticideDosage() {
        return pesticideDosage;
    }

    public void setPesticideDosage(Integer pesticideDosage) {
        this.pesticideDosage = pesticideDosage;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PesticideUsageRecord other = (PesticideUsageRecord) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPesticideTypeId() == null ? other.getPesticideTypeId() == null : this.getPesticideTypeId().equals(other.getPesticideTypeId()))
            && (this.getUsedDate() == null ? other.getUsedDate() == null : this.getUsedDate().equals(other.getUsedDate()))
            && (this.getPlantingLocationId() == null ? other.getPlantingLocationId() == null : this.getPlantingLocationId().equals(other.getPlantingLocationId()))
            && (this.getPesticideAcquireRecordId() == null ? other.getPesticideAcquireRecordId() == null : this.getPesticideAcquireRecordId().equals(other.getPesticideAcquireRecordId()))
            && (this.getVegetableManagementId() == null ? other.getVegetableManagementId() == null : this.getVegetableManagementId().equals(other.getVegetableManagementId()))
            && (this.getAdminId() == null ? other.getAdminId() == null : this.getAdminId().equals(other.getAdminId()))
            && (this.getPesticideDosage() == null ? other.getPesticideDosage() == null : this.getPesticideDosage().equals(other.getPesticideDosage()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPesticideTypeId() == null) ? 0 : getPesticideTypeId().hashCode());
        result = prime * result + ((getUsedDate() == null) ? 0 : getUsedDate().hashCode());
        result = prime * result + ((getPlantingLocationId() == null) ? 0 : getPlantingLocationId().hashCode());
        result = prime * result + ((getPesticideAcquireRecordId() == null) ? 0 : getPesticideAcquireRecordId().hashCode());
        result = prime * result + ((getVegetableManagementId() == null) ? 0 : getVegetableManagementId().hashCode());
        result = prime * result + ((getAdminId() == null) ? 0 : getAdminId().hashCode());
        result = prime * result + ((getPesticideDosage() == null) ? 0 : getPesticideDosage().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", pesticideTypeId=").append(pesticideTypeId);
        sb.append(", usedDate=").append(usedDate);
        sb.append(", plantingLocationId=").append(plantingLocationId);
        sb.append(", pesticideAcquireRecordId=").append(pesticideAcquireRecordId);
        sb.append(", vegetableManagementId=").append(vegetableManagementId);
        sb.append(", adminId=").append(adminId);
        sb.append(", pesticideDosage=").append(pesticideDosage);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}